﻿#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include "qcustomplot.h"

class MyCustomPlot : public QCustomPlot
{
    Q_OBJECT
public:
    MyCustomPlot(QWidget *parent = nullptr);

    virtual ~MyCustomPlot()
    {
    }

protected:
    virtual void mouseMoveEvent(QMouseEvent *event);

private:
    int lastIdx = -1;
    QCPBars *myBars = nullptr;
    QCPItemStraightLine *line = nullptr;  // tooltip的垂直线
};

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();
private:
    MyCustomPlot *customPlot = nullptr;
};
#endif // DIALOG_H
